package com.naodong.shenluntiku.mvp.model;

import com.naodong.shenluntiku.mvp.contract.StudyContract;
import com.naodong.shenluntiku.mvp.model.bean.PagingBean;
import com.naodong.shenluntiku.mvp.model.bean.Study;
import com.naodong.shenluntiku.mvp.model.data.api.CommonApi;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;
import me.shingohu.man.di.scope.ActivityScope;
import me.shingohu.man.intergation.IRepositoryManager;
import me.shingohu.man.intergation.retrofit.NoBodyEntity;
import me.shingohu.man.mvp.BaseModel;

/**
 * Created by Administrator on 2017/5/30.
 */

@ActivityScope
public class StudyModel extends BaseModel implements StudyContract.Model {
    @Inject
    public StudyModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }


    @Override
    public Observable<PagingBean<List<Study>>> getStudys(String url) {
        return mRespositoryManager.obtainRetrofitService(CommonApi.class).getStudys(url);
    }

    @Override
    public Observable<NoBodyEntity> setRead(int rcId) {
        return mRespositoryManager.obtainRetrofitService(CommonApi.class).setRead(rcId);
    }
}
